import { nFormatter } from '@/utils/nFormatter'

export default {
  backgroundColor: '#1c213e',
  tooltip: {
    appendToBody: true,
    formatter: function(val = {}) {
      const {
        data: { name, value = [] },
        marker
      } = val
      const [, _b, _c, _d, _e, _f] = value
      return `
        ${name}:00<br/>
        ${marker}最小值: ${_b}<br/>
        ${marker}25%: ${_c}<br/>
        ${marker}中间值: ${_d}<br/>
        ${marker}75%: ${_e}<br/>
        ${marker}最大值: ${_f}<br/>
      `
    }
  },
  xAxis: {
    type: 'category',
    name: '时间段',
    nameGap: 25,
    nameLocation: 'center',
    show: true,
    nameTextStyle: {
      color: '#fff'
    },
    scale: true,
    position: 'bottom'
  },
  yAxis: [
    {
      scale: true,
      name: '用气量',
      splitArea: {
        show: false
      },
      splitLine: {
        lineStyle: {
          color: '#31597d',
          type: 'dashed'
        }
      },
      nameTextStyle: {
        color: '#fff'
      },
      axisLine: {
        onZero: false,
        lineStyle: {
          color: '#31597d'
        }
      },
      axisLabel: {
        formatter: function(val) {
          return nFormatter(val)
        }
      }
    }
  ],
  series: [
    {
      type: 'boxplot',
      cursor: 'pointer'
    }
  ],
  grid: {
    left: '6%',
    right: '3%',
    top: 40,
    bottom: 45
  }
}
